package com.example.coursaccino;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

public class StudentViewPage extends Activity {
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        setContentView(R.layout.student_view);
        
        // LIST COURSES STUDENT HAS REGISTERED FOR FROM DATABASE
        
//        Toast msg = Toast.makeText(getBaseContext(), "In View Page", Toast.LENGTH_LONG);
//    	msg.show();
        
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
	    switch (item.getItemId()) {
	        case R.id.delOption:     
	        	// DELETE SELECTED COURSE FROM DATABASE, AND SHOW UPDATED LIST OF COURSES
	        	//Toast.makeText(this, "You pressed delete", Toast.LENGTH_LONG).show();
	            break;
	            
	        case R.id.viewOption:    
	        	Intent openNewPage = new Intent(StudentViewPage.this, StudentViewCoursePage.class); 
                StudentViewPage.this.startActivity(openNewPage);
	        	//Toast.makeText(this, "You pressed view course", Toast.LENGTH_LONG).show();
	            break;
	    }
	    return true;
	}
	
	@Override
	  public boolean onCreateOptionsMenu(Menu menu) {
	      getMenuInflater().inflate(R.menu.student_view, menu);
	      return true;
	  }


}
